package com.itheima.个人代码.IO流2;

import java.io.FileWriter;
import java.io.IOException;

public class Demo2 {
    public static void main(String[] args) throws IOException {
        FileWriter fw=new FileWriter("IO流2和对象操作流properties\\stu.txt");
        //demo1(fw);
        //demo2(fw);
        //demo3(fw);
        //demo4(fw);
        demo5(fw);
        fw.close();

    }

    public static void demo4(FileWriter fw) throws IOException {
        String s="您好啊,好久不见,怎么样了..............";
        fw.write(s,0,12);
    }

    public static void demo5(FileWriter fw) throws IOException {
        String s="您好啊,好久不见,怎么样了..............";
        fw.write(s);
    }

    public static void demo3(FileWriter fw) throws IOException {
        char[] chars={'a','b','c','d'};
        fw.write(chars);
    }

    public static void demo2(FileWriter fw) throws IOException {
        char[] chars={'a','b','c','d'};
        fw.write(chars,0,3);
    }

    public static void demo1(FileWriter fw) throws IOException {
        fw.write(97);
        fw.write('q');
        fw.write(97);
        fw.write(97);
    }


}
